import unittest,time
import HTMLTestRunner
from function.MAIL import *

case_dir='./Testcase'
discover=unittest.defaultTestLoader.discover(case_dir,pattern='test*.py')

if __name__=="__main__":
    now =time.strftime("%Y-%m-%d %H_%M_%S")
    report_file='./report/' + now +'.html'
    f=open(report_file,'wb')
    runner= HTMLTestRunner.HTMLTestRunner(stream=f,title=u'测试报告',description=u'测试用例执行的情况',verbosity=2)
    runner.run(discover)
    f.close()
    SendEail()


